package com.eascs.web.demo.db;

import javax.inject.Inject;

import com.eascs.app.dao.JdbcSession;
import com.eascs.app.dao.PageResult;
import com.eascs.app.dao.SqlPageQuery;

public abstract class BaseDao {

	@Inject
	protected JdbcSession jdbcSession;

	public JdbcSession getJdbcSession() {
		return jdbcSession;
	}

	public void setJdbcSession(JdbcSession jdbcSession) {
		this.jdbcSession = jdbcSession;
	}

	public <T> PageResult<T> findByPage(SqlPageQuery<T> sqlPageQuery) {
		return this.jdbcSession.findDataWithPage(sqlPageQuery);
	}

}
